<?php

class Somi_Form_Passwortvergessen extends Zend_Form 
{
	public function init()
	{
		
    	#$this->setAction('/test/index/test');
		#$this->setMethod('post');
		#$this->setName('Edit');
		$this->addAttribs(array('accept-charset' => 'utf-8'));
		
		
		require_once APPLICATION_BASE.'/library/Somi/Validate/ErrorMessageDe.php';
		require_once APPLICATION_BASE.'/library/Somi/Validate/UniqueUser.php';
		#require_once '../application/default/decorators/test.php';
		
		$translateValidators= new Somi_Validate_ErrorMessageDe();
		$translator = new Zend_Translate('array', $translateValidators->getTranslate());
    	Zend_Validate_Abstract::setDefaultTranslator($translator);
		
		
      	#$user =new Valuerisk_Models_User();
      	
		
		$this->clearDecorators();
	
	
		$formDecorators=array(
		'formElements',
		array('HtmlTag',array('tag'=>'dl','class'=>'zend_form')),
		'Form',
		);
		
		$elementDecorators=array(
		'ViewHelper',
		'Errors',
		array(array('data'=>'HtmlTag'),array('tag'=>'div','class'=>'element')),
		array('Label',array('class'=>'left','requiredSuffix' => '*')),
		array(array('row'=>'HtmlTag'),array('tag'=>'div','class'=>'row')),
		);
		
		$buttonDecorators=array(
		'ViewHelper',
		array(array('data'=>'HtmlTag'),array('tag'=>'div','class'=>'buttonrow')),
		array(array('row'=>'HtmlTag'),array('tag'=>'div'))
		);
		
		
		$filterToLower = new Zend_Filter_StringToLower();
        $filterToLower->setEncoding('UTF-8');
		
		
        #Email
        $email=new Zend_Form_Element_Text('email');
        $email->setLabel('Email')
        ->setRequired(true)
        ->setDescription('Email des vergessene Passwort')
        ->addFilter('StripTags')
        ->addFilter('StringTrim')
        ->addFilter($filterToLower);
        $email->addValidator('EmailAddress');
        $email->addPrefixPath('Somi_Validate', APPLICATION_BASE.'/library/Somi/Validate/', 'validate');
        $email->addValidator('ExistEmail',false);
        #$email->addValidator('StringLength', false, array(4, 30));
		$email->setAttrib('class','email');


		
		
		$emailCaptcha=new Zend_Form_Element_Captcha('emailCaptcha',array(
		'label'=>'tippen Sie es ein',
		'captcha'=>array('captcha'=>'Figlet',
		'wordLen'=>3,
		'timeout'=>300,)));
  		

		#Submit
		$submit=new Zend_Form_Element_Submit('submit');
		$submit->setLabel('senden');
		$submit->setAttrib('id','submitbutton');
		$submit->setAttrib('class','form-button');
		
		
		
		# Send Elements
		$this->addElements(array($email,$emaislCaptcha,$submit));
		
		
		$this->setDecorators($formDecorators);
		$this->setElementDecorators($elementDecorators);
		$this->getElement('submit')->setDecorators($buttonDecorators);
	}
}


?>